#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

struct node
{
    int val;
    int id;
    char dir;
};

node que[500000];
int book[500000];
int pre[10], num[10];
int head, tail;

void init()
{
    int i;
    pre[0] = 1;
    for (i = 1; i <= 8; i++)
    {
        pre[i] = pre[i - 1] * i;
    }
    return;
}

int calI(int *ary)
{
    int i, j, res, cnt;
    res = 0;
    for (i = 1; i <= 9; i++)
    {
        cnt = 0;
        for (j = i + 1; j <= 9; j++)
        {
            if (ary[i] > ary[j])
                cnt++;
        }
        res += pre[9 - i] * cnt;
    }
    return res;
}

void calII(int *ary, int val)
{
    int bit[20], bk[20];
    int i, j, cnt;
    for (i = 1; i <= 9; i++)
    {
        bit[i] = val / pre[9 - i];
        val %= pre[9 - i];
    }
    memset(bk, 0, sizeof(bk));
    for (i = 1; i <= 9; i++)
    {
        cnt = 0;
        for (j = 1; j <= 9; j++)
        {
            cnt += (bk[j] ^ 1);
            if (cnt > bit[i])
                break;
        }
        bk[j] = 1;
        ary[i] = j;
    }
    return;
}

void bfs()
{
    node cur;
    int ary[20];
    int i, p, t, val, flag;
    head = 1, tail = 0;
    tail++;
    que[tail].val = 0;
    que[tail].id = -1;
    que[tail].dir = 0;
    book[0] = 1;
    while (head <= tail)
    {
        cur = que[head];
        head++;
        calII(ary, cur.val);
        for (i = 1; i <= 9; i++)
        {
            if (ary[i] == 9)
            {
                p = i;
                break;
            }
        }
        if (p - 3 >= 1) // up
        {
            t = ary[p - 3], ary[p - 3] = ary[p], ary[p] = t;
            val = calI(ary);
            if (!book[val])
            {
                tail++;
                que[tail].val = val;
                que[tail].id = head - 1;
                que[tail].dir = 'd';
                book[val] = tail;
            }
            t = ary[p - 3], ary[p - 3] = ary[p], ary[p] = t;
        }
        if (p + 3 <= 9) // down
        {
            t = ary[p + 3], ary[p + 3] = ary[p], ary[p] = t;
            val = calI(ary);
            if (!book[val])
            {
                tail++;
                que[tail].val = val;
                que[tail].id = head - 1;
                que[tail].dir = 'u';
                book[val] = tail;
            }
            t = ary[p + 3], ary[p + 3] = ary[p], ary[p] = t;
        }
        if ((p - 1) / 3 == (p - 2) / 3) // left
        {
            t = ary[p - 1], ary[p - 1] = ary[p], ary[p] = t;
            val = calI(ary);
            if (!book[val])
            {
                tail++;
                que[tail].val = val;
                que[tail].id = head - 1;
                que[tail].dir = 'r';
                book[val] = tail;
            }
            t = ary[p - 1], ary[p - 1] = ary[p], ary[p] = t;
        }
        if ((p - 1) / 3 == p / 3) // right
        {
            t = ary[p + 1], ary[p + 1] = ary[p], ary[p] = t;
            val = calI(ary);
            if (!book[val])
            {
                tail++;
                que[tail].val = val;
                que[tail].id = head - 1;
                que[tail].dir = 'l';
                book[val] = tail;
            }
            t = ary[p + 1], ary[p + 1] = ary[p], ary[p] = t;
        }
    }
    return;
}

void output(int cur)
{
    if (que[cur].id == -1)
        return;
    printf("%c", que[cur].dir);
    output(que[cur].id);
    return;
}

int main()
{
    int i, val;
    char ch[2];
    init();
    bfs();
    while (scanf("%s", ch) != EOF)
    {
        if (ch[0] == 'x')
            num[1] = 9;
        else
            num[1] = ch[0] - '0';
        for (i = 2; i <= 9; i++)
        {
            scanf("%s", ch);
            if (ch[0] == 'x')
                num[i] = 9;
            else
                num[i] = ch[0] - '0';
        }
        val = calI(num);
        if (val == 0)
        {
            printf("lr\n");
        }
        else if (!book[val])
        {
            printf("unsolvable\n");
        }
        else
        {
            output(book[val]);
            printf("\n");
        }
    }
    return 0;
}